home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 March: Reference Library / Dev.CD Mar 96 RL / Dev.CD Mar 96 RL.toast / Technical Documentation / develop / develop Issue 25 / develop Issue 25 code / Display Manager Sample / Headers / App.h next >
Encoding:
C/C++ Source or Header  |  1995-12-19  |  3.8 KB  |  179 lines  |  [TEXT/MPCC]

  1. /***********************************************************************
  2. #
  3. #        App.h
  4. #
  5. #        This file contains the constants and structure definitions.
  6. #
  7. #        Author: Michael Marinkovich
  8. #                Apple Developer Technical Support
  9. #
  10. #
  11. #        Modification History: 
  12. #
  13. #            6/4/95        MWM     Initial coding                     
  14. #            10/12/95    MWM        cleaned up
  15. #
  16. #        Copyright © 1992-95 Apple Computer, Inc., All Rights Reserved
  17. #
  18. #
  19. ***********************************************************************/
  20.  
  21. #include <QDOffscreen.h>
  22.  
  23.  
  24. //---------------------------------------------------------------------
  25. //
  26. //    Macros
  27. //
  28. //---------------------------------------------------------------------
  29.  
  30. #define MIN(x,y)            ( ((x)<(y)) ? (x) : (y) )
  31. #define MAX(x,y)            ( ((x)>(y)) ? (x) : (y) )
  32. #define TopLeft( r )        ( *(Point *) &(r).top )
  33. #define BotRight( r )        ( *(Point *) &(r).bottom )
  34.  
  35.  
  36. //---------------------------------------------------------------------
  37. //
  38. //    General
  39. //
  40. //---------------------------------------------------------------------
  41.  
  42. #define kMinHeap            300 * 1024
  43. #define kMinSpace            300 * 1024
  44.  
  45.  
  46. //---------------------------------------------------------------------
  47. //
  48. //    Menus
  49. //
  50. //---------------------------------------------------------------------
  51.  
  52. #define rMBarID                128
  53.  
  54. enum {
  55.      mApple                    = 128,
  56.     iAbout                    = 1,
  57.  
  58.     mFile                    = 129,
  59.     iNew                    = 1,
  60.     iOpen                    = 2,
  61.     iClose                    = 3,
  62.     iQuit                    = 5
  63. };
  64.  
  65.  
  66. //---------------------------------------------------------------------
  67. //
  68. //    Window stuff
  69. //
  70. //---------------------------------------------------------------------
  71.  
  72. // doc types
  73. enum {
  74.     kDocKind                = 94,
  75.     kDialogKind                = 95,
  76.     kFloatKind                = 96,
  77.     kAboutKind                = 97
  78. };    
  79.  
  80. #define kFudgeFactor        4        // fudge factor for boundary around window
  81. #define kTitleBarHeight        18        // title bar height
  82.  
  83. // scroll values
  84. #define kScrollWidth        15
  85. #define kScrollDelta        16
  86.  
  87.  
  88. //---------------------------------------------------------------------
  89. //
  90. //    General resource ID's
  91. //
  92. //---------------------------------------------------------------------
  93.  
  94. #define rAboutPictID        3000 // about picture
  95. #define rErrorDlg            128     // main error dialog
  96.  
  97.  
  98. //---------------------------------------------------------------------
  99. //
  100. //    Alert Error ID's
  101. //
  102. //---------------------------------------------------------------------
  103.  
  104. #define kNeedsDisplayManager        128    // ID of no Display Manager
  105.  
  106.  
  107. //---------------------------------------------------------------------
  108. //
  109. //    Custom Event Proc stuff
  110. //
  111. //---------------------------------------------------------------------
  112.  
  113. enum {
  114.     kIdleProc            = 1,
  115.     kMenuProc,
  116.     kInContentProc,
  117.     kInGoAwayProc,
  118.     kInZoomProc,
  119.     kInGrowProc,
  120.     kMUpProc,
  121.     kKeyProc,
  122.     kActivateProc,
  123.     kUpdateProc
  124. };
  125.     
  126.  
  127. //---------------------------------------------------------------------
  128. //
  129. //    Typedefs
  130. //
  131. //---------------------------------------------------------------------
  132.  
  133. // event handling proc
  134. typedef void (*CustomProc)(WindowRef window, void *refCon);
  135.  
  136.  
  137. // we just use the basic events for the callback procs
  138.  
  139. struct DocRec
  140. {    
  141.     CustomProc                    idleProc;            // custom idle proc
  142.     CustomProc                    mMenuProc;            // custom menu proc
  143.     CustomProc                    inContentProc;        // custom content click Proc
  144.     CustomProc                    inGoAwayProc;        // custom inGoAway proc
  145.     CustomProc                    inZoomProc;            // custom inZoom proc
  146.     CustomProc                    inGrowProc;            // custom inGrow proc
  147.     CustomProc                    mUpProc;            // custom mouseUp proc
  148.     CustomProc                    keyProc;            // custom autoKey-keyDown proc
  149.     CustomProc                    activateProc;        // custom activate window proc
  150.     CustomProc                    updateProc;            // custom window update proc
  151.     ControlRef                    hScroll;            // horz scroll bar
  152.     ControlRef                    vScroll;            // vert scroll bar
  153.     GWorldPtr                    world;                // offscreen for pict imaging
  154.     PicHandle                    pict;                // windows picture
  155.     THPrint                        printer;            // apps print record - inited at window int
  156.     Boolean                        dirty;                // document needs saving
  157. };
  158.  
  159. typedef struct DocRec DocRec;
  160. typedef DocRec *DocPtr, **DocHnd;
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.